<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>




    <script>
        // ***随机产生0-1的数可以等于0但不会等于1
        console.log(Math.random());
        // 向上取整
        console.log(Math.ceil(3.6));
        // 向下取整
        console.log(Math.floor(9.9));
        // 找最大值
        console.log(Math.max(3, 6, 6.1, 6.2, 6.3, 6.4))
        // 找最小值
        console.log(Math.min(99.99, 99.89, 99.789, 99.999, 99.99999));
        // 生成 M 到 N 的随机数
        // Math.floor(Math.random() * (M - N + 1)) + N
        // 巨nm重要 不会就嘎 console.log(Math.floor(Math.random() * (15 - 30 + 1)) + 30);
        let re = Math.floor(Math.random() * (30 - 1 + 1)) + 1
        console.log(re);
    </script>
</body>

</html>